home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / workbench / directoryopus4 / dopus4_src / library / dopuslib.a < prev    next >
Text File  |  2000-03-11  |  11KB  |  547 lines

  1. ; Directory Opus 4
  2. ; Original GPL release version 4.12
  3. ; Copyright 1993-2000 Jonathan Potter
  4. ; This program is free software; you can redistribute it and/or
  5. ; modify it under the terms of the GNU General Public License
  6. ; as published by the Free Software Foundation; either version 2
  7. ; of the License, or (at your option) any later version.
  8. ; This program is distributed in the hope that it will be useful,
  9. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. ; GNU General Public License for more details.
  12. ; You should have received a copy of the GNU General Public License
  13. ; along with this program; if not, write to the Free Software
  14. ; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  15. ; All users of Directory Opus 4 (including versions distributed
  16. ; under the GPL) are entitled to upgrade to the latest version of
  17. ; Directory Opus version 5 at a reduced price. Please see
  18. ; http://www.gpsoft.com.au for more information.
  19. ;
  20. ; The release of Directory Opus 4 under the GPL in NO WAY affects
  21. ; the existing commercial status of Directory Opus 5.
  22.  
  23.  
  24.     SECTION code
  25.  
  26.     INCLUDE "exec/types.i"
  27.     INCLUDE "exec/initializers.i"
  28.     INCLUDE "exec/libraries.i"
  29.     INCLUDE "exec/lists.i"
  30.     INCLUDE "exec/alerts.i"
  31.     INCLUDE "exec/resident.i"
  32.     INCLUDE "exec/ports.i"
  33.     INCLUDE "exec/io.i"
  34.     INCLUDE "libraries/dos.i"
  35.     INCLUDE "graphics/rastport.i"
  36.  
  37.     INCLUDE "asmsupp.i"
  38.     INCLUDE "dopusbase.i"
  39.  
  40. * Functions.a
  41.  
  42.     XREF endcode
  43.     XREF GetWBScreen
  44.     XREF Seed
  45.     XREF Random
  46.     XREF StrToUpper
  47.     XREF StrToLower
  48.     XREF DisableGadget
  49.     XREF EnableGadget
  50.     XREF GhostGadget
  51.     XREF _SwapMem
  52.     XREF _LSprintf
  53.     XREF LSprintf
  54.     XREF LCreateExtIO
  55.     XREF LCreatePort
  56.     XREF LDeleteExtIO
  57.     XREF LDeletePort
  58.     XREF LToUpper
  59.     XREF LToLower
  60.     XREF LStrCat
  61.     XREF LStrnCat
  62.     XREF LStrCpy
  63.     XREF LStrnCpy
  64.     XREF LStrCmpI
  65.     XREF LStrnCmpI
  66.     XREF LStrCmp
  67.     XREF LStrnCmp
  68.  
  69. * Functions2.a
  70.  
  71.     XREF BtoCStr
  72.     XREF ActivateStrGad
  73.     XREF RefreshStrGad
  74.  
  75. * Graphics.a
  76.  
  77.     XREF Do3DBox
  78.     XREF Do3DStringBox
  79.     XREF Do3DCycleBox
  80.     XREF DrawCheckMark
  81.     XREF HiliteGad
  82.  
  83. * Filereq.c
  84.  
  85.     XREF _DoFileRequest
  86.     XREF _DoSetBusyPointer
  87.  
  88. * Wildcard.c
  89.  
  90.     XREF _DoParsePattern
  91.     XREF _DoMatchPattern
  92.  
  93. * Dosstuff.c
  94.  
  95.     XREF _DoAssign
  96.     XREF _DoBaseName
  97.     XREF _DoCompareLock
  98.     XREF _DoPathName
  99.     XREF _DoSendPacket
  100.     XREF _DoTackOn
  101.     XREF _DoStampToStr
  102.     XREF _DoStrToStamp
  103.     XREF _DoAllocRemember
  104.     XREF _DoFreeRemember
  105.     XREF _DoFreeRemEntry
  106.     XREF _DoCompareDate
  107.     XREF _DoDoArrow
  108.     XREF _DoStrCombine
  109.     XREF _DoStrConcat
  110.     XREF _DoDecode_RLE
  111.  
  112. * Dosstuff2.c
  113.  
  114.     XREF _DoSearchPathList
  115.     XREF _DoCheckExist
  116.     XREF _DoRawkeyToStr
  117.     XREF _DoDoRMBGadget
  118.     XREF _DoAddGadgets
  119.     XREF _DoCheckNumGad
  120.     XREF _DoCheckHexGad
  121.     XREF _DoAtoh
  122.     XREF _DoDoSimpleRequest
  123.     XREF _DoDoCycleGadget
  124.     XREF _DoDrawRadioButton
  125.     XREF _DoGetButtonImage
  126.     XREF _DoGetCheckImage
  127.     XREF _DoUScoreText
  128.     XREF _DoDo3DFrame
  129.     XREF _DoDoGlassImage
  130.  
  131. * Dosstuff3.c
  132.  
  133.     XREF _DoReadConfig
  134.     XREF _DoSaveConfig
  135.     XREF _DoDefaultConfig
  136.     XREF _DoGetDevices
  137.     XREF _DoAssignGadget
  138.     XREF _DoAssignMenu
  139.     XREF _DoFreeConfig
  140.     XREF _DoCheckConfig
  141.     XREF _DoFindSystemFile
  142.  
  143. * Listview.c
  144.  
  145.     XREF _DoAddListView
  146.     XREF _DoListViewIDCMP
  147.     XREF _DoRemoveListView
  148.     XREF _DoRefreshListView
  149.     XREF _DoFixSliderBody
  150.     XREF _DoFixSliderPot
  151.     XREF _DoGetSliderPos
  152.     XREF _DoShowSlider
  153.  
  154. * Requesters.c
  155.  
  156.     XREF _R_OpenRequester
  157.     XREF _R_CloseRequester
  158.     XREF _R_AddRequesterObject
  159.     XREF _R_RefreshRequesterObject
  160.     XREF _R_ObjectText
  161.  
  162. * Language.c
  163.  
  164.     XREF _DoReadStringFile
  165.     XREF _DoFreeStringFile
  166.  
  167. * Borders.c
  168.  
  169.     XREF _DoAddGadgetBorders
  170.     XREF _DoCreateGadgetBorders
  171.     XREF _DoSelectGadget
  172.  
  173. * Menus.c
  174.  
  175.     XREF _DoFSSetMenuStrip
  176.  
  177. * Chip data
  178.  
  179.     XREF _pdb_cycletop
  180.     XREF _pdb_cyclebot
  181.     XREF _pdb_check
  182.  
  183. * Objects
  184.  
  185.     XREF _SysBase
  186.     XREF _DOpusBase
  187.     XREF _IntuitionBase
  188.     XREF _GfxBase
  189.     XREF _DOSBase
  190.     XREF _LayersBase
  191.     XREF ___MathIeeeSingBasBase
  192.  
  193. start:
  194.     moveq #0,d0
  195.     rts
  196.  
  197. romtag:
  198.     dc.w RTC_MATCHWORD
  199.     dc.l romtag
  200.     dc.l endcode
  201.     dc.b RTF_AUTOINIT
  202.     dc.b VERSION
  203.     dc.b NT_LIBRARY
  204.     dc.b 0
  205.     dc.l dopusname
  206.     dc.l idstring
  207.     dc.l init
  208.  
  209. VERSION  equ 22
  210. REVISION equ 6
  211.  
  212. dopusname:
  213.     DOPUSNAME
  214.  
  215. idstring:
  216.     dc.b 'dopus.library 22.6 (4 Mar 2000) recompiled under GPL license by Jacek Rzeuski',13,10,0
  217.  
  218. dosname:
  219.     dc.b 'dos.library',0
  220. intuitionname:
  221.     dc.b 'intuition.library',0
  222. graphicsname:
  223.     dc.b 'graphics.library',0
  224. layersname:
  225.     dc.b 'layers.library',0
  226. mathieeesingbasname:
  227.     dc.b 'mathieeesingbas.library',0
  228.     ds.w 0
  229.  
  230. init:
  231.     dc.l DOpusBase_SIZEOF
  232.     dc.l functable
  233.     dc.l datatable
  234.     dc.l initroutine
  235.  
  236. functable:
  237.     dc.l Open
  238.     dc.l Close
  239.     dc.l Expunge
  240.     dc.l Null
  241.     dc.l _DoFileRequest
  242.     dc.l Do3DBox
  243.     dc.l Do3DStringBox
  244.     dc.l Do3DCycleBox
  245.     dc.l _DoDoArrow
  246.     dc.l LSprintf
  247.     dc.l LCreateExtIO
  248.     dc.l LCreatePort
  249.     dc.l LDeleteExtIO
  250.     dc.l LDeletePort
  251.     dc.l LToUpper
  252.     dc.l LToLower
  253.     dc.l LStrCat
  254.     dc.l LStrnCat
  255.     dc.l LStrCpy
  256.     dc.l LStrnCpy
  257.     dc.l LStrCmp
  258.     dc.l LStrnCmp
  259.     dc.l LStrCmpI
  260.     dc.l LStrnCmpI
  261.     dc.l _DoStrCombine
  262.     dc.l _DoStrConcat
  263.     dc.l LParsePattern
  264.     dc.l LMatchPattern
  265.     dc.l LParsePatternI
  266.     dc.l LMatchPatternI
  267.     dc.l BtoCStr
  268.     dc.l _DoAssign
  269.     dc.l _DoBaseName
  270.     dc.l _DoCompareLock
  271.     dc.l _DoPathName
  272.     dc.l _DoSendPacket
  273.     dc.l _DoTackOn
  274.     dc.l _DoStampToStr
  275.     dc.l _DoStrToStamp
  276.     dc.l _DoAddListView
  277.     dc.l _DoListViewIDCMP
  278.     dc.l _DoRefreshListView
  279.     dc.l _DoRemoveListView
  280.     dc.l DrawCheckMark
  281.     dc.l FixSliderBody
  282.     dc.l FixSliderPot
  283.     dc.l GetSliderPos
  284.     dc.l _DoAllocRemember
  285.     dc.l _DoFreeRemember
  286.     dc.l _DoSetBusyPointer
  287.     dc.l GetWBScreen
  288.     dc.l _DoSearchPathList
  289.     dc.l _DoCheckExist
  290.     dc.l _DoCompareDate
  291.     dc.l Seed
  292.     dc.l Random
  293.     dc.l StrToUpper
  294.     dc.l StrToLower
  295.     dc.l _DoRawkeyToStr
  296.     dc.l _DoDoRMBGadget
  297.     dc.l _DoAddGadgets
  298.     dc.l ActivateStrGad
  299.     dc.l RefreshStrGad
  300.     dc.l _DoCheckNumGad
  301.     dc.l _DoCheckHexGad
  302.     dc.l _DoAtoh
  303.     dc.l HiliteGad
  304.     dc.l _DoDoSimpleRequest
  305.     dc.l _DoReadConfig
  306.     dc.l _DoSaveConfig
  307.     dc.l _DoDefaultConfig
  308.     dc.l _DoGetDevices
  309.     dc.l _DoAssignGadget
  310.     dc.l _DoAssignMenu
  311.     dc.l _DoFindSystemFile
  312.     dc.l _DoDo3DFrame
  313.     dc.l _DoFreeConfig
  314.     dc.l _DoDoCycleGadget
  315.     dc.l _DoUScoreText
  316.     dc.l DisableGadget
  317.     dc.l EnableGadget
  318.     dc.l GhostGadget
  319.     dc.l _DoDrawRadioButton
  320.     dc.l _DoGetButtonImage
  321.     dc.l _DoShowSlider
  322.     dc.l _DoCheckConfig
  323.     dc.l _DoGetCheckImage
  324.     dc.l _R_OpenRequester
  325.     dc.l _R_CloseRequester
  326.     dc.l _R_AddRequesterObject
  327.     dc.l _R_RefreshRequesterObject
  328.     dc.l DoObjectText
  329.     dc.l _DoDoGlassImage
  330.     dc.l _DoDecode_RLE
  331.     dc.l _DoReadStringFile
  332.     dc.l _DoFreeStringFile
  333.     dc.l _DoFreeRemEntry
  334.     dc.l _DoAddGadgetBorders
  335.     dc.l _DoCreateGadgetBorders
  336.     dc.l _DoSelectGadget
  337.     dc.l _DoFSSetMenuStrip
  338.     dc.l -1
  339.  
  340. datatable:
  341.     INITBYTE LN_TYPE,NT_LIBRARY
  342.     INITLONG LN_NAME,dopusname
  343.     INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
  344.     INITWORD LIB_VERSION,VERSION
  345.     INITWORD LIB_REVISION,REVISION
  346.     INITLONG LIB_IDSTRING,idstring
  347.     dc.l 0
  348.  
  349. initroutine:
  350.     move.l a5,-(sp)
  351.     move.l d0,a5
  352.     move.l a6,db_ExecBase(a5)
  353.     move.l a6,_SysBase
  354.     move.l a0,db_SegList(a5)
  355.  
  356.     move.l a5,_DOpusBase
  357.  
  358.     lea dosname(pc),a1
  359.     moveq.l #0,d0
  360.     move.l 4,a6
  361.     jsr _LVOOpenLibrary(a6)
  362.     move.l d0,db_DOSBase(a5)
  363.     move.l d0,_DOSBase
  364.  
  365.     lea intuitionname(pc),a1
  366.     moveq.l #0,d0
  367.     jsr _LVOOpenLibrary(a6)
  368.     move.l d0,db_IntuitionBase(a5)
  369.     move.l d0,_IntuitionBase
  370.  
  371.     lea graphicsname(pc),a1
  372.     moveq.l #0,d0
  373.     jsr _LVOOpenLibrary(a6)
  374.     move.l d0,db_GfxBase(a5)
  375.     move.l d0,_GfxBase
  376.  
  377.     lea layersname(pc),a1
  378.     moveq.l #0,d0
  379.     jsr _LVOOpenLibrary(a6)
  380.     move.l d0,db_LayersBase(a5)
  381.     move.l d0,_LayersBase
  382.  
  383.     lea mathieeesingbasname(pc),a1
  384.     moveq.l #0,d0
  385.     jsr _LVOOpenLibrary(a6)
  386. ;   move.l d0,db_MathIeeeSingBasBase(a5)
  387.     move.l d0,___MathIeeeSingBasBase
  388.  
  389. ;   jsr _init_dopus_library
  390.  
  391.     lea.l _pdb_cycletop,a0
  392.     move.l a0,pdb_cycletop(a5)
  393.  
  394.     lea.l _pdb_cyclebot,a0
  395.     move.l a0,pdb_cyclebot(a5)
  396.  
  397.     lea.l _pdb_check,a0
  398.     move.l a0,pdb_check(a5)
  399.  
  400.     move.l #0,pdb_Flags(a5)
  401.  
  402.     move.l 4,a6
  403.     move.l a5,d0
  404.     move.l (sp)+,a5
  405.     rts
  406.  
  407. Open:
  408.     addq.w #1,LIB_OPENCNT(a6)
  409.     bclr #LIBB_DELEXP,db_Flags(a6)
  410.     move.l a6,d0
  411.     rts
  412.  
  413. Close:
  414.     moveq.l #0,d0
  415.     subq.w #1,LIB_OPENCNT(a6)
  416.     bne.s   stillopen
  417.     btst #LIBB_DELEXP,db_Flags(a6)
  418.     beq.s   stillopen
  419.     bsr Expunge
  420. stillopen:
  421.     rts
  422.  
  423. Expunge:
  424.     movem.l d2/a5/a6,-(sp)
  425.     move.l a6,a5
  426.     tst.w   LIB_OPENCNT(a5)
  427.     beq.s   notopen
  428.     bset #LIBB_DELEXP,db_Flags(a5)
  429.     moveq.l #0,d0
  430.     bra expungeend
  431. notopen:
  432.     move.l db_SegList(a5),d2
  433.     move.l a5,a1
  434.     move.l 4,a6
  435.     jsr _LVORemove(a6)
  436.  
  437.     move.l db_DOSBase(a5),a1
  438.     jsr _LVOCloseLibrary(a6)
  439.     move.l db_IntuitionBase(a5),a1
  440.     jsr _LVOCloseLibrary(a6)
  441.     move.l db_GfxBase(a5),a1
  442.     jsr _LVOCloseLibrary(a6)
  443.     move.l db_LayersBase(a5),a1
  444.     jsr _LVOCloseLibrary(a6)
  445.  
  446.     moveq.l #0,d0
  447.     move.l a5,a1
  448.     move.w LIB_NEGSIZE(a5),d0
  449.     sub.l d0,a1
  450.     add.w LIB_POSSIZE(a5),d0
  451.     move.l 4,a6
  452.     jsr _LVOFreeMem(a6)
  453.     move.l d2,d0
  454.  
  455. expungeend:
  456.     movem.l (sp)+,d2/a5/a6
  457.     rts
  458.  
  459. Null:
  460.     moveq.l #0,d0
  461.     rts
  462.  
  463. LParsePattern:
  464.     moveq.l #0,d0
  465.     bra doparse
  466. LParsePatternI:
  467.     moveq.l #1,d0
  468. doparse:
  469.     movem.l a2-a6/d2-d7,-(sp)
  470.     move.l d0,-(sp)
  471.     move.l a1,-(sp)
  472.     move.l a0,-(sp)
  473.     jsr _DoParsePattern
  474.     add.l #12,sp
  475.     movem.l (sp)+,a2-a6/d2-d7
  476.     rts
  477.  
  478. LMatchPattern:
  479.     moveq.l #0,d0
  480.     bra domatch
  481. LMatchPatternI:
  482.     moveq.l #1,d0
  483. domatch:
  484.     movem.l a2-a6/d2-d7,-(sp)
  485.     move.l d0,-(sp)
  486.     move.l a1,-(sp)
  487.     move.l a0,-(sp)
  488.     jsr _DoMatchPattern
  489.     add.l #12,sp
  490.     movem.l (sp)+,a2-a6/d2-d7
  491.     rts
  492.  
  493. DoObjectText:
  494.     movem.l a2-a6/d2-d7,-(sp)
  495.     move.l d4,-(sp)
  496.     move.l a1,-(sp)
  497.     move.l d3,-(sp)
  498.     move.l d2,-(sp)
  499.     move.l d1,-(sp)
  500.     move.l d0,-(sp)
  501.     move.l a0,-(sp)
  502.     jsr _R_ObjectText
  503.     add.l #28,sp
  504.     movem.l (sp)+,a2-a6/d2-d7
  505.     rts
  506.  
  507. FixSliderBody:
  508.     movem.l a2-a6/d2-d7,-(sp)
  509.     move.l d2,-(sp)
  510.     move.l d1,-(sp)
  511.     move.l d0,-(sp)
  512.     move.l a1,-(sp)
  513.     move.l a0,-(sp)
  514.     jsr _DoFixSliderBody
  515.     add.l #20,sp
  516.     movem.l (sp)+,a2-a6/d2-d7
  517.     rts
  518.  
  519. FixSliderPot:
  520.     movem.l a2-a6/d2-d7,-(sp)
  521.     move.l d3,-(sp)
  522.     move.l d2,-(sp)
  523.     move.l d1,-(sp)
  524.     move.l d0,-(sp)
  525.     move.l a1,-(sp)
  526.     move.l a0,-(sp)
  527.     jsr _DoFixSliderPot
  528.     add.l #24,sp
  529.     movem.l (sp)+,a2-a6/d2-d7
  530.     rts
  531.  
  532. GetSliderPos:
  533.     movem.l a2-a6/d2-d7,-(sp)
  534.     move.l d1,-(sp)
  535.     move.l d0,-(sp)
  536.     move.l a0,-(sp)
  537.     jsr _DoGetSliderPos
  538.     add.l #12,sp
  539.     movem.l (sp)+,a2-a6/d2-d7
  540.     rts
  541.  
  542.     END
  543.